#ifndef COMMONSHADER_H
#define COMMONSHADER_H

#include <string>
#include "Util.h"

const std::string commonVShader = SHADER(
    #version 330 core\n
    layout(location = 0) in vec3 position;
layout(location = 1) in vec3 normal;
layout(location = 2) in vec2 texCoords;

out vec2 TexCoords;
out vec3 Normal;

out vec3 FragPos;

uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;

void main()
{
    gl_Position = projection * view * model * vec4(position, 1.0f);
    Normal = mat3(transpose(inverse(model))) * normal;
    FragPos = vec3(model * vec4(position, 1.0f));
    TexCoords = texCoords;
}
);


const std::string commonFShader = SHADER(
    #version 330 core\n

    in vec2 TexCoords;
in vec3 Normal;
in vec3 FragPos;

out vec4 color;

uniform sampler2D texture_diffuse1;
uniform vec3 lightPos;
void main()
{
    vec3 norm = normalize(Normal);
    vec3 lightDir = normalize(lightPos.xyz- FragPos);
    color = vec4(1.0,0.0,0.0,0.0)*abs(dot(norm, lightDir.xyz));
}
);


#endif // !COMMONSHADER_H
